package cn.hdu.liang.nio;

import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.nio.file.attribute.BasicFileAttributes;

public class BasicFileAttributesDemo {
    public static void main(String[] args) throws IOException {
        Path file = Paths.get("/home/liang");
        BasicFileAttributes attrs = Files.readAttributes(file, BasicFileAttributes.class);
        System.out.println(attrs.creationTime());
        System.out.println(attrs.lastAccessTime());
        System.out.println(attrs.lastModifiedTime());
        System.out.println(attrs.isDirectory());
        System.out.println(attrs.isOther());
        System.out.println(attrs.isRegularFile());
        System.out.println(attrs.isSymbolicLink());
        System.out.println(attrs.size());
    }
}
